package com.ease.common.vo.editor;

import java.beans.PropertyEditorSupport;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.ease.common.util.Detect;
import com.ease.common.vo.Endpoint;

/**
 * 
 * @author nathanleewei
 * 
 */
public class EndpointEditor extends PropertyEditorSupport {

	private static final String SEPARATOR_COMMA = ";";

	private static final String SEPARATOR_SPACE = " ";

	public List<Endpoint> getEndpoints() {
		// TODO
		return null;
	}

	// also see org.snmp4j.smi.GenericAddress
	public void setAsText(String text) {
		if (null != text) {
			String separator = SEPARATOR_SPACE;
			if (text.indexOf(SEPARATOR_COMMA) > -1) {
				separator = SEPARATOR_COMMA;
			}
			String[] tokens = StringUtils.split(text, separator);
			if (Detect.notEmpty(tokens)) {
				for (String token : tokens) {
					// TODO
				}
			}
		}
	}

}
